Skip to content

Conversation

@patrickfreed
Copy link
Contributor

@patrickfreed patrickfreed requested a review from kmahar February 13, 2020 22:28
@patrickfreed
Copy link
Contributor Author

One problem with this is that it won't ever try to build the changes being released. It'll just verify that the existing examples build against the latest version.

A couple of solutions are possible:

  1. We modify the examples to depend on the repository they're included in (i.e. don't go to GitHub, instead depend on "../.."). Then, update the script to make tags locally, test building the examples, then publish the tags to GitHub if building succeeds.
    • The main problem with this is that the Package.swifts included in our examples aren't really representative of how a user would actually include our project. This may not really be a problem given the example Package.swift we include in the readme.
  2. We search/replace the version string in the examples' Package.swifts and verify they build. Seems messy but it gets the job done.
  3. Assuming we'll have a branch for each minor version, we could point the examples to the latest version branch, verify they build, then publish the version tags afterwards.
    • The main problem here is the same problem here is the same as the first in that it will have a nonstandard Package.swift.
    • As a side note, we'll probably want branches for at least every major version to allow for backporting. We probably want one for each minor version too.

I'm not really sure which of these would be the best approach, or really if any of these is the right one. What do you think?

@kmahar
Copy link
Contributor

kmahar commented Feb 14, 2020

hmmmmm...... I think we should avoid having non-standard Package.swifts. option 2 seems reasonable.
option 2 seems better, but agree it's rather messy.
we could also just make running this script a required step of the release process that occurs right after we publish the tags.

Copy link
Contributor Author

@patrickfreed patrickfreed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted to go for the "messy" route, since the alternative involved us checking if examples worked after we published a release, which would leave broken examples in the repository if anyone ever checked out via a version tag. It ended up being a single simple sed, so the mess isn't too bad.

echo "On macOS: brew install gnu-sed"
exit 43
fi
sed="$ETC_DIR/sed.sh"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was moved to a separate script so that I could use it in build-examples.sh.

echo "================= Building $example_project succeeded ================="
else
echo "================= Building $example_project failed ================="
exit_code=1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was updated so that the script attempts to build all examples now, even if prior builds failed.

@patrickfreed patrickfreed merged commit 0410f35 into master Feb 18, 2020
@patrickfreed patrickfreed deleted the SWIFT-536/test-examples branch February 18, 2020 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants